Video encoding/decoding method and apparatus, and recording medium in which bit stream is stored

ABSTRACT

An image encoding/decoding method and apparatus are provided. An image decoding method performed by an image decoding apparatus according to the present invention may comprise deriving an intra-prediction mode of a current block, and performing intra-prediction for the current block based on the intra-prediction mode. The deriving of the intra-prediction mode may comprise decoding a predetermined mode sameness indicator.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a Continuation Application of U.S. patentapplication Ser. No. 17/319,175, filed on May 13, 2021, which is aContinuation Application of U.S. patent application Ser. No. 16/342,225,filed on Apr. 16, 2019, which is a U.S. National Stage Application ofInternational Application No. PCT/KR2017/011768, filed on Oct. 24, 2017,which claims the benefit under 35 USC 119(a) and 365(b) of Korean PatentApplication No. 10-2016-0142275, filed on Oct. 28, 2016, in the KoreanIntellectual Property Office.

TECHNICAL FIELD

The present invention relates to a method and apparatus forencoding/decoding an image and a recording medium storing a bitstream.Particularly, the present invention relates to a method and apparatusfor encoding/decoding an image efficiently signaling intra predictionmode and a recording medium storing a bitstream generated by an imageencoding method/apparatus of the present invention.

BACKGROUND ART

Recently, demands for high-resolution and high-quality images such ashigh definition (HD) images and ultra high definition (UHD) images, haveincreased in various application fields. However, higher resolution andquality image data has increasing amounts of data in comparison withconventional image data. Therefore, when transmitting image data byusing a medium such as conventional wired and wireless broadbandnetworks, or when storing image data by using a conventional storagemedium, costs of transmitting and storing increase. In order to solvethese problems occurring with an increase in resolution and quality ofimage data, high-efficiency image encoding/decoding techniques arerequired for higher-resolution and higher-quality images.

Image compression technology includes various techniques, including: aninter-prediction technique of predicting a pixel value included in acurrent picture from a previous or subsequent picture of the currentpicture; an intra-prediction technique of predicting a pixel valueincluded in a current picture by using pixel information in the currentpicture; a transform and quantization technique for compressing energyof a residual signal; an entropy encoding technique of assigning a shortcode to a value with a high appearance frequency and assigning a longcode to a value with a low appearance frequency; etc. Image data may beeffectively compressed by using such image compression technology, andmay be transmitted or stored.

DISCLOSURE Technical Problem

An object of the present invention is to provide a method and apparatusfor encoding and decoding an image to enhance compression efficiency.

Another object of the present invention is to provide a method andapparatus for encoding and decoding an image efficiently signaling intraprediction mode.

Another object of the present invention is to provide a recording mediumstoring a bitstream generated by an image encoding method/apparatus ofthe present invention.

Technical Solution

An image decoding method performed by an image decoding apparatusaccording to the present invention may comprise deriving anintra-prediction mode of a current block, and performingintra-prediction for the current block based on the intra-predictionmode.

In the image decoding method according to the present invention, thederiving of the intra-prediction mode may comprise decoding apredetermined mode sameness indicator, and the predetermined modesameness indicator may indicate whether or not the intra-prediction modeof the current block is identical to a predetermined mode.

In the image decoding method according to the present invention, thepredetermined mode may be one of an inter-prediction mode of at leastone neighbor block of the current block, a DC mode and a planar mode.

In the image decoding method according to the present invention, whenthe predetermined mode sameness indicator has a first value, theintra-prediction mode of the current block may be derived as thepredetermined mode.

In the image decoding method according to the present invention, whenthe predetermined mode sameness indicator has a second value, thederiving of the intra-prediction mode may further comprise configuringan MPM list for the current block and decoding an MPM matching indicatorfor the MPM list, and the MPM matching indicator may indicate whether ornot the intra-prediction mode of the current block is included in theMPM list.

In the image decoding method according to the present invention, whenthe MPM matching indicator has a first value, an MPM index for the MPMlist may be decoded, and the intra-prediction mode of the current blockmay be derived as a candidate mode indicated by the MPM index amongcandidate modes included in the MPM list.

In the image decoding method according to the present invention, whenthe MPM matching indicator has a second value, intra-prediction modeindicating information may be decoded, and the intra-prediction mode ofthe current block may be derived as a mode indicated by theintra-prediction mode indicating information.

In the image decoding method according to the present invention, in theconfiguring of the MPM list, a plurality of MPM lists may be configured,and a number of candidate modes included in each of the plurality of MPMlists may be different.

In the image decoding method according to the present invention, whenthe intra-prediction mode of the current block is included in a firstMPM list among the plurality of MPM lists and the first MPM listincludes a single candidate mode, an MPM index for the first MPM listmay not be decoded.

In the image decoding method according to the present invention, thepredetermined mode sameness indicator may be decoded based on at leastone among a slice type, a coding parameter, a size and a form of thecurrent block.

An image encoding method performed by an image encoding apparatusaccording to the present invention may comprise determining anintra-prediction mode of a current block, performing intra-predictionfor the current block based on the intra-prediction mode, and encodingthe intra-prediction mode.

In the image encoding method according to the present invention, theencoding of the intra-prediction mode may comprise encoding apredetermined mode sameness indicator, and the predetermined modesameness indicator may indicate whether or not the intra-prediction modeof the current block is identical to a predetermined mode.

In the image encoding method according to the present invention, whenthe intra-prediction mode of the current block is identical to thepredetermined mode, the predetermined mode sameness indicator having afirst value may be encoded.

In the image encoding method according to the present invention, whenthe intra-prediction mode of the current block is different from thepredetermined mode, the predetermined mode sameness indicator having asecond value may be encoded, and the encoding of the intra-predictionmode may further comprise configuring an MPM list for the current blockand encoding an MPM matching indicator for the MPM list, and the MPMmatching indicator may indicate whether or not the intra-prediction modeof the current block is included in the MPM list.

In the image encoding method according to the present invention, whenthe intra-prediction mode of the current block is included in the MPMlist, the MPM matching indicator having a first value, and an MPM indexfor the MPM list may be encoded, and the MPM index may be an indexindicating the intra-prediction mode of the current block amongcandidate modes included in the MPM list.

In the image encoding method according to the present invention, whenthe intra-prediction mode of the current block is not included in theMPM list, the MPM matching indicator having a second value andintra-prediction mode indicating information may be encoded, and theintra-prediction mode indicating information may be informationindicating the intra-prediction mode of the current block.

In the image encoding method according to the present invention, in theconfiguring of the MPM list, a plurality of MPM lists may be configured,and a number of candidates modes included in each of the plurality ofMPM lists may be different.

In the image encoding method according to the present invention, whenthe intra-prediction mode of the current block is included in a firstMPM list of the plurality of MPM lists and the first MPM list includes asingle candidate mode, an MPM index for the first MPM list may not beencoded.

In the image encoding method according to the present invention, thepredetermined mode sameness indicator may be encoded based on at leastone among a slice type, a coding parameter, a size and a form of thecurrent block.

A recording medium according to the present invention may store abitstream generated by an image encoding method according to the presentinvention.

Advantageous Effects

According to the present invention, a method and apparatus for encodingand decoding an image to enhance compression efficiency may be provided.

According to the present invention, a method and apparatus for encodingand decoding an image efficiently signaling intra prediction mode may beprovided.

According to the present invention, a recording medium storing abitstream generated by an image encoding method/apparatus of the presentinvention may be provided.

DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram showing configurations of an encodingapparatus according to an embodiment of the present invention.

FIG. 2 is a block diagram showing configurations of a decoding apparatusaccording to an embodiment of the present invention.

FIG. 3 is a view schematically showing a partition structure of an imagewhen encoding and decoding the image.

FIG. 4 is a view for explaining an embodiment of a process of intraprediction.

FIG. 5 is a view for illustrating intra-prediction according to thepresent invention.

FIG. 6 is a view for illustrating step S510 of deriving anintra-prediction mode according to the present invention.

FIG. 7 is a view for illustrating at least one neighbor block of thecurrent block.

FIG. 8 is a view for illustrating encoding of an intra-prediction modeof a current block.

FIG. 9 is a view for illustrating decoding of an intra-prediction modeof a current block

MODE FOR CARRYING OUT THE INVENTION

A variety of modifications may be made to the present invention andthere are various embodiments of the present invention, examples ofwhich will now be provided with reference to drawings and described indetail. However, the present invention is not limited thereto, althoughthe exemplary embodiments can be construed as including allmodifications, equivalents, or substitutes in a technical concept and atechnical scope of the present invention. The similar reference numeralsrefer to the same or similar functions in various aspects. In thedrawings, the shapes and dimensions of elements may be exaggerated forclarity. In the following detailed description of the present invention,references are made to the accompanying drawings that show, by way ofillustration, specific embodiments in which the invention may bepracticed. These embodiments are described in sufficient detail toenable those skilled in the art to implement the present disclosure. Itshould be understood that various embodiments of the present disclosure,although different, are not necessarily mutually exclusive. For example,specific features, structures, and characteristics described herein, inconnection with one embodiment, may be implemented within otherembodiments without departing from the spirit and scope of the presentdisclosure. In addition, it should be understood that the location orarrangement of individual elements within each disclosed embodiment maybe modified without departing from the spirit and scope of the presentdisclosure. The following detailed description is, therefore, not to betaken in a limiting sense, and the scope of the present disclosure isdefined only by the appended claims, appropriately interpreted, alongwith the full range of equivalents to what the claims claim.

Terms used in the specification, ‘first’, ‘second’, etc. can be used todescribe various components, but the components are not to be construedas being limited to the terms. The terms are only used to differentiateone component from other components. For example, the ‘first’ componentmay be named the ‘second’ component without departing from the scope ofthe present invention, and the ‘second’ component may also be similarlynamed the ‘first’ component. The term ‘and/or includes a combination of’a plurality of items or any one of a plurality of terms.

It will be understood that when an element is simply referred to asbeing ‘connected to’ or ‘coupled to’ another element without being‘directly connected to’ or ‘directly coupled to’ another element in thepresent description, it may be ‘directly connected to’ or ‘directlycoupled to’ another element or be connected to or coupled to anotherelement, having the other element intervening therebetween. In contrast,it should be understood that when an element is referred to as being“directly coupled” or “directly connected” to another element, there areno intervening elements present.

Furthermore, constitutional parts shown in the embodiments of thepresent invention are independently shown so as to representcharacteristic functions different from each other. Thus, it does notmean that each constitutional part is constituted in a constitutionalunit of separated hardware or software. In other words, eachconstitutional part includes each of enumerated constitutional parts forconvenience. Thus, at least two constitutional parts of eachconstitutional part may be combined to form one constitutional part orone constitutional part may be divided into a plurality ofconstitutional parts to perform each function. The embodiment where eachconstitutional part is combined and the embodiment where oneconstitutional part is divided are also included in the scope of thepresent invention, if not departing from the essence of the presentinvention.

The terms used in the present specification are merely used to describeparticular embodiments, and are not intended to limit the presentinvention. An expression used in the singular encompasses the expressionof the plural, unless it has a clearly different meaning in the context.In the present specification, it is to be understood that terms such as“including”, “having”, etc. are intended to indicate the existence ofthe features, numbers, steps, actions, elements, parts, or combinationsthereof disclosed in the specification, and are not intended to precludethe possibility that one or more other features, numbers, steps,actions, elements, parts, or combinations thereof may exist or may beadded. In other words, when a specific element is referred to as being“included”, elements other than the corresponding element are notexcluded, but additional elements may be included in embodiments of thepresent invention or the scope of the present invention.

In addition, some of constituents may not be indispensable constituentsperforming essential functions of the present invention but be selectiveconstituents improving only performance thereof. The present inventionmay be implemented by including only the indispensable constitutionalparts for implementing the essence of the present invention except theconstituents used in improving performance. The structure including onlythe indispensable constituents except the selective constituents used inimproving only performance is also included in the scope of the presentinvention.

Hereinafter, embodiments of the present invention will be described indetail with reference to the accompanying drawings. In describingexemplary embodiments of the present invention, well-known functions orconstructions will not be described in detail since they mayunnecessarily obscure the understanding of the present invention. Thesame constituent elements in the drawings are denoted by the samereference numerals, and a repeated description of the same elements willbe omitted.

In addition, hereinafter, an image may mean a picture configuring avideo, or may mean the video itself. For example, “encoding or decodingor both of an image” may mean “encoding or decoding or both of a video”,and may mean “encoding or decoding or both of one image among images ofa video.” Here, a picture and the image may have the same meaning.

Description of Terms

Encoder: means an apparatus performing encoding.

Decoder: means an apparatus performing decoding

Block: is an M×N array of a sample. Herein, M and N mean positiveintegers, and the block may mean a sample array of a two-dimensionalform. The block may refer to a unit. A current block my mean an encodingtarget block that becomes a target when encoding, or a decoding targetblock that becomes a target when decoding. In addition, the currentblock may be at least one of an encode block, a prediction block, aresidual block, and a transform block.

Sample: is a basic unit constituting a block. It may be expressed as avalue from 0 to 2^(Bd)−1 according to a bit depth (B_(d)). In thepresent invention, the sample may be used as a meaning of a pixel.

Unit: refers to an encoding and decoding unit. When encoding anddecoding an image, the unit may be a region generated by partitioning asingle image. In addition, the unit may mean a subdivided unit when asingle image is partitioned into subdivided units during encoding ordecoding. When encoding and decoding an image, a predetermined processfor each unit may be performed. A single unit may be partitioned intosub-units that have sizes smaller than the size of the unit. Dependingon functions, the unit may mean a block, a macroblock, a coding treeunit, a code tree block, a coding unit, a coding block), a predictionunit, a prediction block, a residual unit), a residual block, atransform unit, a transform block, etc. In addition, in order todistinguish a unit from a block, the unit may include a luma componentblock, a chroma component block associated with the luma componentblock, and a syntax element of each color component block. The unit mayhave various sizes and forms, and particularly, the form of the unit maybe a two-dimensional geometrical figure such as a rectangular shape, asquare shape, a trapezoid shape, a triangular shape, a pentagonal shape,etc. In addition, unit information may include at least one of a unittype indicating the coding unit, the prediction unit, the transformunit, etc., and a unit size, a unit depth, a sequence of encoding anddecoding of a unit, etc.

Coding Tree Unit: is configured with a single coding tree block of aluma component Y, and two coding tree blocks related to chromacomponents Cb and Cr. In addition, it may mean that including the blocksand a syntax element of each block. Each coding tree unit may bepartitioned by using at least one of a quad-tree partitioning method anda binary-tree partitioning method to configure a lower unit such ascoding unit, prediction unit, transform unit, etc. It may be used as aterm for designating a pixel block that becomes a process unit whenencoding/decoding an image as an input image.

Coding Tree Block: may be used as a term for designating any one of a Ycoding tree block, Cb coding tree block, and Cr coding tree block.

Neighbor Block: means a block adjacent to a current block. The blockadjacent to the current block may mean a block that comes into contactwith a boundary of the current block, or a block positioned within apredetermined distance from the current block. The neighbor block maymean a block adjacent to a vertex of the current block. Herein, theblock adjacent to the vertex of the current block may mean a blockvertically adjacent to a neighbor block that is horizontally adjacent tothe current block, or a block horizontally adjacent to a neighbor blockthat is vertically adjacent to the current block.

Reconstructed Neighbor block: means a neighbor block adjacent to acurrent block and which has been already spatially/temporally encoded ordecoded. Herein, the reconstructed neighbor block may mean areconstructed neighbor unit. A reconstructed spatial neighbor block maybe a block within a current picture and which has been alreadyreconstructed through encoding or decoding or both. A reconstructedtemporal neighbor block is a block at the same position as the currentblock of the current picture within a reference picture, or a neighborblock thereof.

Unit Depth: means a partitioned degree of a unit. In a tree structure, aroot node may be the highest node, and a leaf node may be the lowestnode. In addition, when a unit is expressed as a tree structure, a levelin which a unit is present may mean a unit depth.

Bitstream: means a bitstream including encoding image information.

Parameter Set: corresponds to header information among a configurationwithin a bitstream. At least one of a video parameter set, a sequenceparameter set, a picture parameter set, and an adaptation parameter setmay be included in a parameter set. In addition, a parameter set mayinclude a slice header, and tile header information.

Parsing: may mean determination of a value of a syntax element byperforming entropy decoding, or may mean the entropy decoding itself.

Symbol: may mean at least one of a syntax element, a coding parameter,and a transform coefficient value of an encoding/decoding target unit.In addition, the symbol may mean an entropy encoding target or anentropy decoding result.

Prediction Unit: means a basic unit when performing prediction such asinter-prediction, intra-prediction, inter-compensation,intra-compensation, and motion compensation. A single prediction unitmay be partitioned into a plurality of partitions with a small size, ormay be partitioned into a lower prediction unit.

Prediction Unit Partition: means a form obtained by partitioning aprediction unit.

Transform Unit: means a basic unit when performing encoding/decodingsuch as transform, inverse-transform, quantization, dequantization,transform coefficient encoding/decoding of a residual signal. A singletransform unit may be partitioned into a plurality of transform unitshaving a small size.

FIG. 1 is a block diagram showing a configuration of an encodingapparatus according to an embodiment to which the present invention isapplied.

An encoding apparatus 100 may be an encoder, a video encoding apparatus,or an image encoding apparatus. A video may include at least one image.The encoding apparatus 100 may sequentially encode at least one image.

Referring to FIG. 1 , the encoding apparatus 100 may include a motionprediction unit 111, a motion compensation unit 112, an intra-predictionunit 120, a switch 115, a subtractor 125, a transform unit 130, aquantization unit 140, an entropy encoding unit 150, a dequantizationunit 160, a inverse-transform unit 170, an adder 175, a filter unit 180,and a reference picture buffer 190.

The encoding apparatus 100 may perform encoding of an input image byusing an intra mode or an inter mode or both. In addition, encodingapparatus 100 may generate a bitstream through encoding the input image,and output the generated bitstream. The generated bitstream may bestored in a computer readable recording medium, or may be streamedthrough a wired/wireless transmission medium. When an intra mode is usedas a prediction mode, the switch 115 may be switched to an intra.Alternatively, when an inter mode is used as a prediction mode, theswitch 115 may be switched to an inter mode. Herein, the intra mode maymean an intra-prediction mode, and the inter mode may mean aninter-prediction mode. The encoding apparatus 100 may generate aprediction block for an input block of the input image. In addition, theencoding apparatus 100 may encode a residual of the input block and theprediction block after the prediction block being generated. The inputimage may be called as a current image that is a current encodingtarget. The input block may be called as a current block that is currentencoding target, or as an encoding target block.

When a prediction mode is an intra mode, the intra-prediction unit 120may use a pixel value of a block that has been already encoded/decodedand is adjacent to a current block as a reference pixel. Theintra-prediction unit 120 may perform spatial prediction by using areference pixel, or generate prediction samples of an input block byperforming spatial prediction. Herein, the intra prediction may meanintra-prediction,

When a prediction mode is an inter mode, the motion prediction unit 111may retrieve a region that best matches with an input block from areference image when performing motion prediction, and deduce a motionvector by using the retrieved region. The reference image may be storedin the reference picture buffer 190.

The motion compensation unit 112 may generate a prediction block byperforming motion compensation using a motion vector. Herein,inter-prediction may mean inter-prediction or motion compensation.

The subtractor 125 may generate a residual block by using a residual ofan input block and a prediction block. The residual block may be calledas a residual signal. The residual signal may mean a difference betweenan original signal and a prediction signal. In addition, the residualsignal may be a signal generated by transforming or quantizing, ortransforming and quantizing a difference between the original signal andthe prediction signal. The residual block may be a residual signal of ablock unit.

The transform unit 130 may generate a transform coefficient byperforming transform of a residual block, and output the generatedtransform coefficient. Herein, the transform coefficient may be acoefficient value generated by performing transform of the residualblock. When a transform skip mode is applied, the transform unit 130 mayskip transform of the residual block.

A quantized level may be generated by applying quantization to thetransform coefficient or to the residual signal. Hereinafter, thequantized level may be also called as a transform coefficient inembodiments.

The quantization unit 140 may generate a quantized level by quantizingthe transform coefficient or the residual signal according to aparameter, and output the generated quantized level. Herein, thequantization unit 140 may quantize the transform coefficient by using aquantization matrix.

The entropy encoding unit 150 may generate a bitstream by performingentropy encoding according to a probability distribution on valuescalculated by the quantization unit 140 or on coding parameter valuescalculated when performing encoding, and output the generated bitstream.The entropy encoding unit 150 may perform entropy encoding of pixelinformation of an image and information for decoding an image. Forexample, the information for decoding the image may include a syntaxelement.

When entropy encoding is applied, symbols are represented so that asmaller number of bits are assigned to a symbol having a high chance ofbeing generated and a larger number of bits are assigned to a symbolhaving a low chance of being generated, and thus, the size of bit streamfor symbols to be encoded may be decreased. The entropy encoding unit150 may use an encoding method for entropy encoding such as exponentialGolomb, context-adaptive variable length coding (CAVLC),context-adaptive binary arithmetic coding (CABAC), etc. For example, theentropy encoding unit 150 may perform entropy encoding by using avariable length coding/code (VLC) table. In addition, the entropyencoding unit 150 may deduce a binarization method of a target symboland a probability model of a target symbol/bin, and perform arithmeticcoding by using the deduced binarization method, and a context model.

In order to encode a transform coefficient level, the entropy encodingunit 150 may change a two-dimensional block form coefficient into aone-dimensional vector form by using a transform coefficient scanningmethod.

A coding parameter may include information (flag, index, etc.) such assyntax element that is encoded in an encoder and signaled to a decoder,and information derived when performing encoding or decoding. The codingparameter may mean information required when encoding or decoding animage. For example, at least one value or a combination form of aunit/block size, a unit/block depth, unit/block partition information,unit/block partition structure, whether to partition of a quad-treeform, whether to partition of a binary-tree form, a partition directionof a binary-tree form (horizontal direction or vertical direction), apartition form of a binary-tree form (symmetric partition or asymmetricpartition), an intra-prediction mode/direction, a reference samplefiltering method, a prediction block filtering method, a predictionblock filter tap, a prediction block filter coefficient, aninter-prediction mode, motion information, a motion vector, a referencepicture index, a inter-prediction angle, an inter-prediction indicator,a reference picture list, a reference picture, a motion vector predictorcandidate, a motion vector candidate list, whether to use a merge mode,a merge candidate, a merge candidate list, whether to use a skip mode,an interpolation filter type, an interpolation filter tab, aninterpolation filter coefficient, a motion vector size, a presentationaccuracy of a motion vector, a transform type, a transform size,information of whether or not a primary (first) transform is used,information of whether or not a secondary transform is used, a primarytransform index, a secondary transform index, information of whether ornot a residual signal is present, a coded block pattern, a coded blockflag (CBF), a quantization parameter, a quantization matrix, whether toapply an intra loop filter, an intra loop filter coefficient, an intraloop filter tab, an intra loop filter shape/form, whether to apply adeblocking filter, a deblocking filter coefficient, a deblocking filtertab, a deblocking filter strength, a deblocking filter shape/form,whether to apply an adaptive sample offset, an adaptive sample offsetvalue, an adaptive sample offset category, an adaptive sample offsettype, whether to apply an adaptive in-loop filter, an adaptive in-loopfilter coefficient, an adaptive in-loop filter tab, an adaptive in-loopfilter shape/form, a binarization/inverse-binarization method, a contextmodel determining method, a context model updating method, whether toperform a regular mode, whether to perform a bypass mode, a context bin,a bypass bin, a transform coefficient, a transform coefficient level, atransform coefficient level scanning method, an imagedisplaying/outputting sequence, slice identification information, aslice type, slice partition information, tile identificationinformation, a tile type, tile partition information, a picture type, abit depth, and information of a luma signal or chroma signal may beincluded in the coding parameter.

Herein, signaling the flag or index may mean that a corresponding flagor index is entropy encoded and included in a bitstream by an encoder,and may mean that the corresponding flag or index is entropy decodedfrom a bitstream by a decoder.

When the encoding apparatus 100 performs encoding throughinter-prediction, an encoded current image may be used as a referenceimage for another image that is processed afterwards. Accordingly, theencoding apparatus 100 may reconstruct or decode the encoded currentimage, or store the reconstructed or decoded image as a reference image.

A quantized level may be dequantized in the dequantization unit 160, ormay be inverse-transformed in the inverse-transform unit 170. Adequantized or inverse-transformed coefficient or both may be added witha prediction block by the adder 175. By adding the dequantized orinverse-transformed coefficient or both with the prediction block, areconstructed block may be generated. Herein, the dequantized orinverse-transformed coefficient or both may mean a coefficient on whichat least one of dequantization and inverse-transform is performed, andmay mean a reconstructed residual block.

A reconstructed block may pass through the filter unit 180. The filterunit 180 may apply at least one of a deblocking filter, a sampleadaptive offset (SAO), and an adaptive loop filter (ALF) to thereconstructed block or a reconstructed image. The filter unit 180 may becalled as an in-loop filter.

The deblocking filter may remove block distortion generated inboundaries between blocks. In order to determine whether or not to applya deblocking filter, whether or not to apply a deblocking filter to acurrent block may be determined based pixels included in several rows orcolumns which are included in the block. When a deblocking filter isapplied to a block, another filter may be applied according to arequired deblocking filtering strength.

In order to compensate an encoding error, a proper offset value may beadded to a pixel value by using a sample adaptive offset. The sampleadaptive offset may correct an offset of a deblocked image from anoriginal image by a pixel unit. A method of partitioning pixels of animage into a predetermined number of regions, determining a region towhich an offset is applied, and applying the offset to the determinedregion, or a method of applying an offset in consideration of edgeinformation on each pixel may be used.

The adaptive loop filter may perform filtering based on a comparisonresult of the filtered reconstructed image and the original image.Pixels included in an image may be partitioned into predeterminedgroups, a filter to be applied to each group may be determined, anddifferential filtering may be performed for each group. Information ofwhether or not to apply the ALF may be signaled by coding units (CUs),and a form and coefficient of the ALF to be applied to each block mayvary.

The reconstructed block or the reconstructed image having passed throughthe filter unit 180 may be stored in the reference picture buffer 190.FIG. 2 is a block diagram showing a configuration of a decodingapparatus according to an embodiment and to which the present inventionis applied.

A decoding apparatus 200 may a decoder, a video decoding apparatus, oran image decoding apparatus.

Referring to FIG. 2 , the decoding apparatus 200 may include an entropydecoding unit 210, a dequantization unit 220, a inverse-transform unit230, an intra-prediction unit 240, a motion compensation unit 250, anadder 225, a filter unit 260, and a reference picture buffer 270.

The decoding apparatus 200 may receive a bitstream output from theencoding apparatus 100. The decoding apparatus 200 may receive abitstream stored in a computer readable recording medium, or may receivea bitstream that is streamed through a wired/wireless transmissionmedium. The decoding apparatus 200 may decode the bitstream by using anintra mode or an inter mode. In addition, the decoding apparatus 200 maygenerate a reconstructed image generated through decoding or a decodedimage, and output the reconstructed image or decoded image.

When a prediction mode used when decoding is an intra mode, a switch maybe switched to an intra. Alternatively, when a prediction mode used whendecoding is an inter mode, a switch may be switched to an inter mode.

The decoding apparatus 200 may obtain a reconstructed residual block bydecoding the input bitstream, and generate a prediction block. When thereconstructed residual block and the prediction block are obtained, thedecoding apparatus 200 may generate a reconstructed block that becomes adecoding target by adding the reconstructed residual block with theprediction block. The decoding target block may be called a currentblock.

The entropy decoding unit 210 may generate symbols by entropy decodingthe bitstream according to a probability distribution. The generatedsymbols may include a symbol of a quantized level form. Herein, anentropy decoding method may be a inverse-process of the entropy encodingmethod described above.

In order to decode a transform coefficient level, the entropy decodingunit 210 may change a one-directional vector form coefficient into atwo-dimensional block form by using a transform coefficient scanningmethod.

A quantized level may be dequantized in the dequantization unit 220, orinverse-transformed in the inverse-transform unit 230. The quantizedlevel may be a result of dequantizing or inverse-transforming or both,and may be generated as a reconstructed residual block. Herein, thedequantization unit 220 may apply a quantization matrix to the quantizedlevel.

When an intra mode is used, the intra-prediction unit 240 may generate aprediction block by performing spatial prediction that uses a pixelvalue of a block adjacent to a decoding target block and which has beenalready decoded.

When an inter mode is used, the motion compensation unit 250 maygenerate a prediction block by performing motion compensation that usesa motion vector and a reference image stored in the reference picturebuffer 270.

The adder 225 may generate a reconstructed block by adding thereconstructed residual block with the prediction block. The filter unit260 may apply at least one of a deblocking filter, a sample adaptiveoffset, and an adaptive loop filter to the reconstructed block orreconstructed image. The filter unit 260 may output the reconstructedimage. The reconstructed block or reconstructed image may be stored inthe reference picture buffer 270 and used when performinginter-prediction.

FIG. 3 is a view schematically showing a partition structure of an imagewhen encoding and decoding the image. FIG. 3 schematically shows anexample of partitioning a single unit into a plurality of lower units.

In order to efficiently partition an image, when encoding and decoding,a coding unit (CU) may be used. The coding unit may be used as a basicunit when encoding/decoding the image. In addition, the coding unit maybe used as a unit for distinguishing an intra mode and an inter modewhen encoding/decoding the image. The coding unit may be a basic unitused for prediction, transform, quantization, inverse-transform,dequantization, or an encoding/decoding process of a transformcoefficient.

Referring to FIG. 3 , an image 300 is sequentially partitioned in alargest coding unit (LCU), and a LCU unit is determined as a partitionstructure. Herein, the LCU may be used in the same meaning as a codingtree unit (CTU). A unit partitioning may mean partitioning a blockassociated with to the unit. In block partition information, informationof a unit depth may be included. Depth information may represent anumber of times or a degree or both in which a unit is partitioned. Asingle unit may be partitioned in a layer associated with depthinformation based on a tree structure. Each of partitioned lower unitmay have depth information. Depth information may be informationrepresenting a size of a CU, and may be stored in each CU.

A partition structure may mean a distribution of a coding unit (CU)within an LCU 310. Such a distribution may be determined according towhether or not to partition a single CU into a plurality (positiveinteger equal to or greater than 2 including 2, 4, 8, 16, etc.) of CUs.A horizontal size and a vertical size of the CU generated bypartitioning may respectively be half of a horizontal size and avertical size of the CU before partitioning, or may respectively havesizes smaller than a horizontal size and a vertical size beforepartitioning according to a number of times of partitioning. The CU maybe recursively partitioned into a plurality of CUs. Partitioning of theCU may be recursively performed until to a predefined depth orpredefined size. For example, a depth of an LCU may be 0, and a depth ofa smallest coding unit (SCU) may be a predefined maximum depth. Herein,the LCU may be a coding unit having a maximum coding unit size, and theSCU may be a coding unit having a minimum coding unit size as describedabove. Partitioning is started from the LCU 310, a CU depth increases by1 as a horizontal size or a vertical size or both of the CU decreases bypartitioning.

In addition, information whether or not the CU is partitioned may berepresented by using partition information of the CU. The partitioninformation may be 1-bit information. All CUs, except for a SCU, mayinclude partition information. For example, when a value of partitioninformation is 1, the CU may not be partitioned, when a value ofpartition information is 2, the CU may be partitioned.

Referring to FIG. 3 , an LCU having a depth 0 may be a 64×64 block. 0may be a minimum depth. A SCU having a depth 3 may be an 8×8 block. 3may be a maximum depth. A CU of a 32×32 block and a 16×16 block may berespectively represented as a depth 1 and a depth 2.

For example, when a single coding unit is partitioned into four codingunits, a horizontal size and a vertical size of the four partitionedcoding units may be a half size of a horizontal and vertical size of theCU before being partitioned. In one embodiment, when a coding unithaving a 32×32 size is partitioned into four coding units, each of thefour partitioned coding units may have a 16×16 size. When a singlecoding unit is partitioned into four coding units, it may be called thatthe coding unit may be partitioned into a quad-tree form.

For example, when a single coding unit is partitioned into two codingunits, a horizontal or vertical size of the two coding units may be ahalf of a horizontal or vertical size of the coding unit before beingpartitioned. For example, when a coding unit having a 32×32 size ispartitioned in a vertical direction, each of two partitioned codingunits may have a size of 16×32. When a single coding unit is partitionedinto two coding units, it may be called that the coding unit ispartitioned in a binary-tree form. An LCU 320 of FIG. 3 is an example ofan LCU to which both of partitioning of a quad-tree form andpartitioning of a binary-tree form are applied.

FIG. 4 is a view showing an intra-prediction process.

An intra-prediction mode may be a non-angular mode or an angular mode.The non-angular mode may be a DC mode or a planar mode, and the angularmode may be a prediction mode having a specific direction or angle. Theintra-prediction mode may be expressed by at least one of a mode number,a mode value, a mode numeral, and a mode angle. A number ofintra-prediction modes may be M including 1, and the non-angular and theangular mode.

A number of intra-prediction modes may be fixed to N regardless of ablock size. Alternatively, a number of intra-prediction modes may varyaccording to a block size or a color component type or both. Forexample, as a block size becomes large, a number of intra-predictionmodes may increase. Alternatively, a number of intra-prediction modes ofa luma component block may be larger than a number of intra-predictionmodes of a chroma component block.

In order to intra-predict a current block, a step of determining whetheror not samples included in a reconstructed neighbor block may be used asreference samples of the current block may be performed. When a samplethat is not usable as a reference sample of the current block ispresent, a value obtained by duplicating or performing interpolation onat least one sample value among samples included in the reconstructedneighbor block or both may be used to replace with a non-usable samplevalue of a sample, thus the replaced sample value is used as a referencesample of the current block.

When intra-predicting, a filter may be applied to at least one of areference sample and a prediction sample based on an intra-predictionmode and a current block size.

2 In case of a planar mode, when generating a prediction block of acurrent block, according to a position of a prediction target samplewithin a prediction block, a sample value of the prediction targetsample may be generated by using a weighted sum of an upper and leftside reference sample of a current sample, and a right upper side andleft lower side reference sample of the current block. In addition, incase of a DC mode, when generating a prediction block of a currentblock, an average value of upper side and left side reference samples ofthe current block may be used. In addition, in case of an angular mode,a prediction block may be generated by using an upper side, a left side,a right upper side, and/or a left lower side reference sample of thecurrent block. In order to generate a prediction sample value,interpolation of a real number unit may be performed.

An intra-prediction mode of a current block may be entropyencoded/decoded by predicting an intra-prediction mode of a blockpresent adjacent to the current block. When intra-prediction modes ofthe current block and the neighbor block are identical, information thatthe intra-prediction modes of the current block and the neighbor blockare identical may be signaled by using predetermined flag information.In addition, indicator information of an intra-prediction mode that isidentical to the intra-prediction mode of the current block amongintra-prediction modes of a plurality of neighbor blocks may besignaled. When intra-prediction modes of the current block and theneighbor block are different, intra-prediction mode information of thecurrent block may be entropy encoded/decoded by performing entropyencoding/decoding based on the intra-prediction mode of the neighborblock.

FIG. 5 is a view for illustrating intra-prediction according to thepresent invention.

Intra-prediction for a current block may include at least one of stepS510 of deriving an intra-prediction mode, step S520 of configuring areference sample, and step S530 of performing intra-prediction.

In step S510, an intra-prediction mode of a current block may bederived. The intra-prediction mode of the current block may be derivedby using at least one of a method using at least one of a slice type, aquantization parameter QP, a block size, and a block form, a method ofdetermining a predetermined mode sameness, a method of configuring andclassifying an MPM list, and a method of entropy encoding/decodingprediction mode information.

In step S520, the reference sample may be configured by performing atleast one of reference sample selecting and reference sample filtering.

In step S530, intra-prediction for the current block may be performed byusing at least one of non-angular prediction, angular prediction, andchroma intra prediction (LM: Linear Model). In addition, when performingintra-prediction, filtering for a prediction sample may be performed.

Over-head may be reduced by using an MPM mode and a non-MPM mode forsignaling the intra-prediction mode. An indicator for distinguishing theabove modes may be signaled (for example, prev_intra_luma_pred_flag).

The MPM list may be configured by including n MPM candidate modes.

The n may be an integer equal to or greater than 1. The MPM candidatemode may be selected from an intra prediction mode of a neighbor blockof the current block, a planar mode, and a DC mode, or an LM mode. Whenthe MPM list includes a number of candidate modes which is smaller thann, a neighbor mode of an angular mode among modes that are added to theMPM list may be included in the MPM list. The neighbor mode may be amode corresponding to an angular mode+m and an angular mode−m. The m maybe an integer equal to or greater than 1. When the MPM list includes anumber of candidate modes which is smaller than n afterwards, a defaultmode may be included in the MPM list. For example, the default mode maybe a mode having a high occurrence frequency such as horizontal mode,vertical mode, a 45 degrees mode, a 135 degrees mode, etc.

When there is a big difference in an actual occurrence frequency of anMPM candidate mode, the MPM candidate mode is classified based on theactual occurrence frequency, thus the intra-prediction mode may beeffectively signaled.

Table 1 is a table showing results and probabilities of selectedintra-prediction modes that are encoded in two encoding configurationswhich are All Intra and Random Access in a BasketballDrill sequence.

TABLE 1 non QP MPM 1 MPM 2 MPM 3 MPM 4 MPM 5 MPM 6 MPM BasketballDrill(All Intra)(%) 22 35.8 19.5 5.4 9.6 7.2 5.0 17.5 27 34.9 18.8 5.7 9.46.2 4.5 20.5 32 32.3 18.5 6.7 9.6 5.7 4.5 23.3 37 30.6 18.8 8.0 7.6 5.03.9 26.1 BasketballDrill (Random Access)(%) 22 32.4 16.3 5.1 6.5 5.6 4.030.1 27 32.4 16.9 5.5 7.3 5.6 3.9 28.3 32 31.5 16.7 6.2 7.2 4.4 3.4 30.637 28.5 17.3 7.0 5.8 4.3 3.4 33.7

As Table 1 suggests, the intra-prediction mode of the current block isidentical to a candidate mode 1 (MPM 1) of the MPM list with the highestprobability. In other words, among candidate modes included in the MPMlist, the MPM 1 has the highest occurrence frequency. Therefore, anindicator indicating that the MPM 1 is identical to the intra-predictionmode of the current block (for example, X mode flag) is signaled so thatindex information such as mode_Idx may not be additionally signaled. Themode_Idx may an index indicating a mode that is identical to theintra-prediction mode of the current block among modes included in theMPM list.

The MPM 1 may correspond to a predetermined mode of the presentinvention. For example, the predetermined mode may be a first candidatemode of the MPM list. However, it is not limited thereto, and it may bea fixed mode (for example, DC mode or planar mode), or a k-th candidatemode of the MPM list.

In case of a P or B slice, intra-prediction for a neighbor block of thecurrent block may be rarely performed. Therefore, there is highprobability that the MPM list may be configured to include a fixed mode.Alternatively, in case of an I slice, there is high probability in thatthe MPM list may be configured by using an intra-prediction mode of aneighbor block. In other words, according to the slice type, a method ofconfiguring the MPM list may vary. Therefore, based on the slice type, amethod of signaling the intra-prediction mode may be adaptivelyselected.

Referring again to Table 1, when a quantization parameter QP becomessmaller, the probability that the MPM 1 is identical to theintra-prediction mode of the current block becomes high. In other words,when the QP becomes smaller, the probability in that the MPM 1 isselected becomes high. Therefore, according to the QP, a method ofsignaling the intra-prediction mode may be adaptively selected.

Alternatively, both of the slice types to which the current blockbelongs and the QP of the current block may be considered.

FIG. 6 is a view for illustrating step S510 of deriving anintra-prediction mode according to the present invention.

Deriving of the intra-prediction mode of the current block may includeat least one of step S610 of selecting an encoding/decoding (signaling)method, step S620 of determining a predetermined mode sameness, stepS630 of configuring an MPM list, and step S640 performingencoding/decoding of a prediction mode. The encoding/decoding may meanentropy encoding/decoding.

In step S610, an encoding/decoding method used for encoding/decoding theintra-prediction mode of the current block may be selected. Selecting ofthe encoding/decoding method may be performed based on at least one of acoding parameter of the current block, a slice type to which the currentblock belongs, a quantization parameter of the current block, a size ofthe current block, and a form of the current block. For example, byselecting the encoding/decoding method, at least one of step S620 ofdetermining the predetermined mode sameness, step S630 of configuringthe MPM list, and step S640 of encoding/decoding of the prediction modemay be differently performed.

In step S620, whether or not the intra-prediction mode of the currentblock is identical to the predetermined mode may be determined.

In step S630, based on the above sameness determination, the MPM listmay be configured. The MPM list may be configured with k layers, andeach layer may include a number of candidate modes, and the number maybe identical or different.

In step S640, intra-prediction mode information for signaling theintra-prediction mode of the current block may be encoded/decoded. Theintra-prediction mode information may include at least one of apredetermined mode sameness indicator, the intra-prediction mode of thecurrent block, an indicator indicating whether or not theintra-prediction mode of the current block is included in the MPM list,and an index of the MPM list.

When a number of intra-prediction modes defined in an encoder/decoder ism, m intra-prediction modes may be grouped in a plurality of groups.Each group may include at least one intra-prediction mode. A number ofintra-prediction modes included in each group may be identical, or maybe different for at least one group. For a specific group of theplurality of groups, it may be limited to include a fixed number ofintra-prediction modes that is pre-defined in the encoder/decoder. Thefixed number may be, for example, n equal to or greater than 1.

Coding information (group indicating information) that specifies a groupincluding the intra-prediction mode of the current block among theplurality of groups may be signaled. The group indicating informationmay be expressed as an index representing a specific group.Alternatively, the group indicating information may be expressed as aflag representing whether or not the intra-prediction mode of thecurrent block is present in a corresponding group for each group. Forexample, when n groups are present, at least one to maximum n−1 flagsmay be signaled.

At least one of the n−1 flags may be selectively encoded/decoded basedon at least one of a slice type, a quantization parameter QP, a block(CU, PU, or TU) size or form or both. For example, signaling of a flagor an index or both of a specific group may be skipped based on at leastone of a slice type, a quantization parameter, a block size or form orboth. For example, according to whether or not a slice type is a Islice, signaling of a first flag may be skipped. Alternatively, whetheror not a quantization parameter is smaller than a first threshold value,signaling of a first flag may be skipped. Alternatively, according to atleast one of whether or not a block size is equal to or greater than apredetermined size (N×M, N and M may be identical or different), whetheror not a number of samples within the block is smaller than a secondthreshold value, and whether or not a block form is an asymmetric form,a square form, etc., signaling of a first flag may be skipped.

The above description is not limited to the first flag, and it may beidentically or similarly applied to a second flag, a third flag, ann−1th flag, etc. The first threshold value or the second threshold valueor both may be a fixed value that is pre-defined in the encoder/decoder,or may be variably derived based on a slice type, a block size/form, abit depth, a quantization parameter, etc.

When a plurality of intra-prediction modes are included within a group,a flag or index representing a position of the intra-prediction mode ofthe current block may be additionally signaled. When a singleintra-prediction mode is included within the group, the flag or indexmay not be signaled.

In addition, the flag may be selectively encoded/decoded according to adependency between groups. For example, when the intra-prediction modeof the current block is not present in a first group (first flag=0), aflag (second flag) representing whether or not the intra-prediction modeis present in a second group may be signaled. Similarly, when the secondflag is 0, a flag (third flag) representing whether or not theintra-prediction mode of the current block is present in a third groupmay be signaled.

In order to signal the intra-prediction mode of the current block,whether or not the intra-prediction mode is identical to a predeterminedmode is determined. The MPM list is configured based on this, andintra-prediction mode information may be encoded/decoded.

An indicator indicating whether or not the intra-prediction mode of thecurrent block is identical to the predetermined mode (predetermined modesameness indicator) may be encoded/decoded. The predetermined mode maybe at least one of an intra-prediction mode of at least one neighborblock of the current block, a DC mode and a planar mode. Alternatively,the predetermined mode may be a mode included in any one of the abovegroups (for example, first group).

FIG. 7 is a view for illustrating at least one neighbor block of thecurrent block.

An intra-prediction mode of a neighbor block at a specific positionamong neighbor blocks of the current block may be the predeterminedmode. For example, the predetermined mode may be T. Herein, when a modecorresponding to is not present, one of an intra-prediction mode, a DCmode, and a planar mode of another neighbor block at another positionmay be the predetermined mode. For example, the intra-prediction mode ofthe neighbor block at another position may be ‘c’. When both of and ‘c’are not present, a DC mode or a planar mode may be the predeterminedmode.

When the intra-prediction mode of the current block is identical to thepredetermined mode, the encoder may encode a predetermined mode samenessindicator having a value 1 (first value). The decoder may derive theintra-prediction mode of the current block as the predetermined modewhen the decoder receives a predetermined mode sameness indicator havinga value 1.

When the intra-prediction mode of the current block is not identical tothe predetermined mode, the encoder may encode a predetermined modesameness indicator having a value 2 (second value). In continuation, theencoder may encode an MPM matching indicator. The MPM matching indicatormay be an indicator representing whether or not a mode identical to theintra-prediction mode of the current block is present within an MPMlist. The decoder may decode an MPM matching indicator when the decoderreceives a predetermined mode sameness indicator having a value 0.

The MPM list may be configured by using an intra-prediction mode of atleast one neighbor block. The MPM list may include n candidate modesaccording to a predetermined order. Referring to FIG. 7 , for example,the MPM list may be configured by including candidate modes in an orderof ‘c’, planar, DC, ‘g’, ‘d’, and ‘a’. Herein, when the candidate modeis identical to the predetermined mode or is identical to a mode that isalready included in the MPM list, the candidate mode may not be added tothe MPM list. When a number of candidate modes includes in the MPM listis smaller than n, at least one of an angular mode+1, an angular mode−1,the angular mode being included in the MPM list, a horizontal mode, avertical mode, a 45 degrees mode, a 135 degrees mode, and a 225 degreesmode may be added to the MPM list.

When the intra-prediction mode of the current block is included in theMPM list, the encoder may encode an MPM matching indicator having avalue 1 (first value) and an MPM index for the MPM list. The MPM indexmay be an index indicating a mode identical to the intra-prediction modeof the current block among candidate modes included in the MPM list. Thedecoder may decode an MPM index when the decoder receives an MPMmatching indicator having a value 1, and derive the intra-predictionmode of the current block by using the MPM list and the MPM index.

When the intra-prediction mode of the current block is not included inthe MPM list, the encoder may encode an MPM matching indicator having avalue 0 (second value) and information indicating the intra-predictionmode of the current block. The information indicating theintra-prediction mode of the current block (intra-prediction modeindicating information) may be information indicating a modecorresponding to the predetermined mode and the intra-prediction mode ofthe current block among modes except for the predetermined mode andcandidate modes included in the MPM list. The decoder may derive theintra-prediction mode of the current block by decoding intra-predictionmode indicating information when the decoder receives an MPM matchingindicator having a value 0.

Table 2 is a table showing bins of the MPM index according to at leastone of the predetermined mode sameness indicator (for example, X modeflag), the MPM matching indicator (for example, MPM flag), and the MPMindex (for example, MPM Idx) value.

TABLE 2 predetermined mode MPM matching sameness indicator indicator MPM(X mode flag) (MPM flag) Idx MPM Idx bins bins 1 — — 1 0 1 0 0 3 1 1 0 42 1 1 0 5 3 1 1 1 0 6 4 1 1 1 1 6

In Table 2, when the predetermined mode sameness indicator has a value1, signaling for additionally indicating the mode is not required. Inother words, when the predetermined mode sameness indicator is 1, theintra-prediction mode of the current block may be derived as thepredetermined mode.

As described above, in order to signal the intra-prediction mode of thecurrent block, M MPM lists may be configured. Herein, each MPM list mayinclude N candidate modes. Herein, M or N may be an integer equal to orgreater than 1.

For example, a single MPM list including six candidate modes may beconfigured. For example, referring to FIG. 7 , according to an order of‘c’, planar, DC, ‘g’, ‘d’, and ‘a’, the MPM list may be configured. Whenthe candidate mode is overlapped or the candidate mode is not present sothat the MPM list is not set, the MPM list may be configured by addingat least one of an angular mode+1, an angular mode−1, the angular modebeing included in the MPM list, a horizontal mode, a vertical mode, a 45degrees mode, a 135 degrees mode, and a 225 degrees mode.

For example, two MPM lists may be configured. The first MPM list mayinclude a single candidate mode. The second MPM list may include fivecandidate modes. For example, referring to FIG. 7 , according to anorder of ‘c’, planar, DC, ‘g’, ‘d’, and ‘a’, the first MPM list may beconfigured first. After, the second MPM list may be configured. Aprocess performed when the MPM list is not set with the candidate modeis as described above.

For example, two MPM lists may be configured. The first MPM list mayinclude three candidate modes. The second MPM list may include threecandidate modes. For example, referring to FIG. 7 , according to anorder of ‘c’, planar, DC, ‘g’, ‘d’, and ‘a’, the first MPM list may beconfigured first, and the second MPM list may be configured afterwards.Alternatively, according to the above order the candidate modes may beincluded in the first MPM list and the second MPM list in turn. Aprocess performed when the MPM list is not set with the candidate modeis as described above.

For example, two MPM lists may be configured. The first MPM list mayinclude two candidate modes. The second MPM list may include fourcandidate modes. For example, referring to FIG. 7 , according to anorder of planar, DC, ‘c’, ‘g’, ‘d’, and ‘a’, the first MPM list may beconfigured first, and the second MPM list may be configured afterwards.Alternatively, according to the above order, the candidate modes may beincluded the first MPM list and the second MPM list in turn. A processperformed when the MPM list is not set to the candidate mode is asdescribed above.

FIG. 8 is a view for illustrating encoding of an intra-prediction modeof a current block.

The intra-prediction mode information may be at least one ofintra-prediction mode indicating information of the current block, apredetermined mode sameness indicator, an MPM matching indicator, and anMPM index.

In step S810, whether or not an intra-prediction mode of the currentblock is identical to a predetermined mode may be determined. When theintra-prediction mode of the current block is identical to thepredetermined mode, in step S820, a predetermined mode samenessindicator having a first value (for example, 1) may be encoded.Otherwise, in step S830, at least one MPM list may be configured.

In step S840, whether or not the intra-prediction mode of the currentblock is included in the MPM list may be determined. When theintra-prediction mode of the current block is included in the MPM list,in step S850, a predetermined mode sameness indicator having a secondvalue (for example, 0), an MPM matching indicator having a first value,and an MPM index may be encoded. Otherwise, in step S860, apredetermined mode sameness indicator having a second value, an MPMmatching indicator having a second value, and intra-prediction modeindicating information of the current block may be encoded.

FIG. 9 is a view for illustrating decoding of an intra-prediction modeof a current block

In step S910, a predetermined mode sameness indicator may be decoded.When the predetermined mode sameness indicator has a first value, instep S920, a predetermined mode may be derived. In step S970, anintra-prediction mode of a current block may be derived based on this.When the predetermined mode sameness indicator has a second value, instep S930, an MPM list may be configured.

In step S940, an MPM matching indicator may be decoded. When the MPMmatching indicator has a first value, in step S950, an MPM index may bedecoded, and in step S970, the intra-prediction mode of the currentblock may be derived based on this. When the MPM matching indicator hasa second value, in step S960, intra-prediction mode indicatinginformation of the current block may be decoded, and in step S970, theintra-prediction mode of the current block may be derived.

When the MPM list includes a single candidate mode and the MPM matchingindicator has a first value, the MPM index may not be encoded/decoded.Herein, the intra-prediction mode of the current block may be derived asthe candidate mode.

In the embodiment described with reference to FIG. 8 and FIG. 9 , aplurality of MPM lists may be present. For example, two MPM lists mayrespectively include a single MPM candidate mode and five MPM candidatemodes. As described above, an MPM index for the MPM list including asingle candidate mode may not be encoded/decoded. When a plurality ofMPM lists is present, according to a predetermined order, an MPMmatching indicator may be sequentially encoded/decoded. An MPM matchingindicator for an n-th MPM list may be encoded/decoded when an MPMmatching indicator for an n−1th MPM list has a second value. An MPMindex for a corresponding MPM list may be encoded/decoded when an MPMmatching indicator for a corresponding MPM list has a first value. Theintra-prediction mode indicating information of the current block may beencoded/decoded when all MPM matching indicators for MPM lists have asecond value.

In order to encode/decode the intra-prediction mode information, atleast one binarization method may be used. The binarization method mayinclude at least one of a truncated rice binarization method, a k-thorder Exp_Golomb binarization method, a constrained k-th orderExp_Golomb binarization method, a fixed-length binarization method, aunary binarization method, and a truncated unary binarization method.

Table 3 shows bins of MPM indexes when a single MPM list including sixcandidate modes is used, and a truncated unary binarization method isused for processing binarization.

TABLE 3 MPM MPM flag Idx MPM Idx bins bins 1 0 0 2 1 1 0 3 2 1 1 0 4 3 11 1 0 5 4 1 1 1 1 0 6 5 1 1 1 1 1 6

Table 4 shows bins of MPM indexes when a first MPM list including asingle candidate mode and a second MPM list including five candidatemodes are used, and a truncated unary binarization method is used forprocessing binarization.

TABLE 4 1st MPM 2nd MPM flag flag MPM Idx MPM Idx bins bins 1 — — 1 0 10 0 3 1 1 0 4 2 1 1 0 5 3 1 1 1 0 6 4 1 1 1 1 6

The total number of bits for expressing six candidate modes of Table 3is 26 bits, and the total number of bits for expressing six candidatemodes of Table 4 is 25 bits. This is because, a single predeterminedmode of Table 4 may be expressed by using one bit. When a predeterminedmode is selected as an intra-prediction mode, in the binarization methodof Table 4, a number of bits equal to a number of selected predeterminedmodes may be reduced more than the binarization method of Table 3.

As described above, selecting of an encoding/decoding method used forencoding/decoding an intra-prediction mode of a current block may beperformed based on at least one of a coding parameter of the currentblock, a slice type of a slice to which the current block belongs, aquantization parameter of the current block, a size of the currentblock, and a form of the current block.

In detail, at least one of performing whether or not to determine apredetermined mode sameness, a number of MPM lists, and a number of MPMcandidate modes to be included in each MPM list may be determinedaccording to a slice type to which the current block belong. Forexample, when a slice to which the current block belongs is at least oneof a I slice, a P slice, and a B slice, determining of the predeterminedmode sameness may be performed, a single MPM list may be configured, ortwo MPM lists may be configured.

Alternatively, based on a result obtained by comparing a QP of thecurrent block with a threshold value, for example, when the QP of thecurrent block is smaller than the threshold value, determining of thepredetermined mode sameness may be performed, a single MPM list may beconfigured, or two MPM lists may be configured. Alternatively, when theQP of the current block is greater than the threshold value, the aboveprocess may be performed.

Alternatively, when the current block has a predetermined size (4×4,8×8, 16×16, 32×32, 32×16, etc.), determining of the predetermined modesameness may be performed, a single MPM list may be configured, or twoMPM lists may be configured.

Alternatively, when the current block has a specific form (square, 1:2rectangle, 2:1 rectangle, 4:1 rectangle, 1:4 rectangle, etc.),determining of the predetermined mode sameness may be performed, asingle MPM list may be configured, or two MPM lists may be configured.

Alternatively, when at least two of the above conditions are satisfied,the above process may be performed. For example, when a slice type is aI slice and a QP value of the current block is smaller than a thresholdvalue, an encoding/decoding method may vary. For example, when a slicetype is a I slice and the current block is a square block having an 8×8size, an encoding/decoding method may vary.

In addition to selecting of the encoding/decoding method describedabove, a predetermined mode according to the present invention may beadaptively derived according to a coding parameter of a current block, aslice type, and a block size or form or both. In addition, a derivingorder and a deriving method of an MPM candidate mode according to thepresent invention may be adaptively determined according to a codingparameter, a slice type, and a block size and/or a form of the currentblock.

Information representing whether or not an intra-prediction modesignaling method according to the present invention (for example,indicator such as flag, etc.) is applicable may be signaled in a higherlevel of a block. The higher level may be, for example, at least one ofa video, a sequence, a picture, a slice, a tile, a CTU, and a CU. Forexample, when it is determined that an intra-prediction mode signalingmethod according to the present invention is effective after encoding aspecific slice (or, sequence or picture), information indicating whetheror not the intra-prediction mode signaling method according to thepresent invention is applicable may be included in a slice header (or,sequence parameter set (SPS) or picture parameter set (PPS)). When theintra-prediction mode signaling method according to the presentinvention is applied, information of a predetermined mode may besignaled. The information of the predetermined mode may be informationfor deriving the predetermined mode. For example, the information of thepredetermined mode may indicate a first mode, an n-th mode, a DC mode,or a planar mode included in an MPM list. When information for derivingthe predetermined mode is not signaled, the predetermined mode may bederived by using a default method. For example, the default method maybe a method of deriving a first candidate mode of an MPM list as thepredetermined mode.

Information representing whether or not an intra-prediction modesignaling method according to the present invention is applicable andinformation of a predetermined mode may be signaled in levels differentfrom each other. For example, when the intra-prediction mode signalingmethod according to the present invention is applicable in a picturelevel, the information of the predetermined mode may be differentlytransmitted from a slice level. Herein, a method of deriving apredetermined mode of each slice included in a corresponding picture mayvary.

Based on the derived intra-prediction mode, a reference sample forintra-prediction may be configured. In the following description, acurrent block may mean a prediction block or a sub-block having asize/form smaller than a size/form of the prediction block. Thereference sample may be configured by using at least one sample that isreconstructed adjacent to the current block or by using a combinationthereof. In addition, filtering may be applied when configuring thereference sample.

A number of reconstructed sample lines or positions thereof or bothwhich is used for configuring the reference sample may vary according toa position of a current block within a coding tree block. Eachreconstructed sample of a plurality of reconstructed sample lines may beused as the reference sample as it is. Alternatively, a predeterminedfilter may be applied to the reconstructed sample, and the referencesample may be generated by using the filtered reconstructed sample. Thereconstructed samples to which the filter is applied may belong to anidentical reconstructed sample line or to another reconstructed sampleline.

The configured reference sample may be represented as ref[m, n], and aneighbor reconstructed sample or a sample obtained by applying filteringthereof may be represented as rec[m, n]. Herein, m or n may be apredetermined integer representing a position of a sample. When aposition of a left upper side sample within the current block is (0, 0),a position of a left upper side reference sample of the current blockmay be set to (−1, −1).

In order to configure the reference sample, it may be determined whetheror not a neighbor reconstructed sample is available. When the neighborreconstructed sample is positioned outside of at least one of a picture,a slice, a tile, and a CTU, the neighbor reconstructed sample may bedetermined as unavailable. Alternatively, when constrainedintra-prediction is performed for a current block, and the neighborreconstructed sample is positioned in a block that is interencoded/decoded, the neighbor reconstructed sample may be determined asunavailable.

When the neighbor reconstructed sample is determined as unavailable, anunavailable sample may be replaced by using an available neighborreconstructed sample. For example, the unavailable sample may be set byusing available samples starting from a left lower side positionedsample. Alternatively, the unavailable sample may be replaced by using acombination of available samples. For example, the unavailable samplemay be replaced with an average value of available samples positioned atboth ends of the unavailable sample.

Alternatively, the unavailable samples may be replaced by usinginformation of available samples. Herein, the unavailable samples may bereplaced with an arbitrary value rather than an available neighborsample value. The arbitrary value may be an average value of availablesample values, or may be a value in consideration of gradients ofavailable sample values. Alternatively, both of the average value andthe gradient may be used. The gradient may be determined based on aresidual value of available neighbor samples. Alternatively, it may bedetermined based on the average value and a residual value of availablesample values. In addition to the average value, a maximum value, aminimum value, a median value, or a weighted sun using an arbitraryweight may be used. The arbitrary weight may be determined based on adistance between an available sample and an unavailable sample.

The above methods may be applied to all upper and left side referencesamples or may be applied only to an arbitrary angle. In addition, theabove methods may be applied when a reference sample line of the currentblock is configured by using a plurality of reconstructed sample lines.

Whether to apply filtering to at least one configured reference samplemay be determined based on at least one of an intra-prediction mode ofthe current block, and a block size/form. When filtering is applied, afilter type may vary according to the intra-prediction mode, the size,and the form of the current block.

Intra-prediction for the current block may be performed based on thederived intra-prediction mode and the reference sample.

In case of a DC mode, an average value of at least one of the configuredreference samples may be used. Herein, filtering may be applied to atleast one prediction sample positioned at a boundary of the currentblock. DC prediction may be differently performed based on at least oneof a size and a form of the current block. For example, based on a sizeor form or both of the current block, a range of a reference sample usedin a DC mode may be specified.

In case of a planar mode, according to a position of an intra-predictiontarget sample of the current block, a weighted sum in consideration of adistance from at least one reference sample may be used.

In case of an angular mode, at least one reference sample present on apredetermined angle line at a position of an intra-prediction targetsample and present adjacent to the intra-prediction target sample may beused.

When performing intra-prediction between color components, for example,intra-prediction for a chroma component may be performed by suing areconstructed luma component of a current block. Alternatively,intra-prediction for another chroma component (for example, Cr) may beperformed by using a single reconstructed chroma component (for example,Cb) of the current block.

The above embodiments may be performed in the same method in an encoderand a decoder.

A sequence of applying to above embodiment may be different between anencoder and a decoder, or the sequence applying to above embodiment maybe the same in the encoder and the decoder.

The above embodiment may be performed on each luma signal and chromasignal, or the above embodiment may be identically performed on luma andchroma signals.

A block form to which the above embodiments of the present invention areapplied may have a square form or a non-square form.

The above embodiment of the present invention may be applied dependingon a size of at least one of a coding block, a prediction block, atransform block, a block, a current block, a coding unit, a predictionunit, a transform unit, a unit, and a current unit. Herein, the size maybe defined as a minimum size or maximum size or both so that the aboveembodiments are applied, or may be defined as a fixed size to which theabove embodiment is applied. In addition, in the above embodiments, afirst embodiment may be applied to a first size, and a second embodimentmay be applied to a second size. In other words, the above embodimentsmay be applied in combination depending on a size. In addition, theabove embodiments may be applied when a size is equal to or greater thata minimum size and equal to or smaller than a maximum size. In otherwords, the above embodiments may be applied when a block size isincluded within a certain range.

For example, the above embodiments may be applied when a size of currentblock is 8×8 or greater. For example, the above embodiments may beapplied when a size of current block is 4×4 or greater. For example, theabove embodiments may be applied when a size of current block is 16×16or greater. For example, the above embodiments may be applied when asize of current block is equal to or greater than 16×16 and equal to orsmaller than 64×64.

The above embodiments of the present invention may be applied dependingon a temporal layer. In order to identify a temporal layer to which theabove embodiments may be applied may be signaled, and the aboveembodiments may be applied to a specified temporal layer identified bythe corresponding identifier. Herein, the identifier may be defined asthe lowest layer or the highest layer or both to which the aboveembodiment may be applied, or may be defined to indicate a specificlayer to which the embodiment is applied. In addition, a fixed temporallayer to which the embodiment is applied may be defined.

For example, the above embodiments may be applied when a temporal layerof a current image is the lowest layer. For example, the aboveembodiments may be applied when a temporal layer identifier of a currentimage is 1. For example, the above embodiments may be applied when atemporal layer of a current image is the highest layer.

A slice type to which the above embodiments of the present invention areapplied may be defined, and the above embodiments may be applieddepending on the corresponding slice type.

In the above-described embodiments, the methods are described based onthe flowcharts with a series of steps or units, but the presentinvention is not limited to the order of the steps, and rather, somesteps may be performed simultaneously or in different order with othersteps. In addition, it should be appreciated by one of ordinary skill inthe art that the steps in the flowcharts do not exclude each other andthat other steps may be added to the flowcharts or some of the steps maybe deleted from the flowcharts without influencing the scope of thepresent invention.

The embodiments include various aspects of examples. All possiblecombinations for various aspects may not be described, but those skilledin the art will be able to recognize different combinations.Accordingly, the present invention may include all replacements,modifications, and changes within the scope of the claims.

The embodiments of the present invention may be implemented in a form ofprogram instructions, which are executable by various computercomponents, and recorded in a computer-readable recording medium. Thecomputer-readable recording medium may include stand-alone or acombination of program instructions, data files, data structures, etc.The program instructions recorded in the computer-readable recordingmedium may be specially designed and constructed for the presentinvention, or well-known to a person of ordinary skilled in computersoftware technology field. Examples of the computer-readable recordingmedium include magnetic recording media such as hard disks, floppydisks, and magnetic tapes; optical data storage media such as CD-ROMs orDVD-ROMs; magneto-optimum media such as floptical disks; and hardwaredevices, such as read-only memory (ROM), random-access memory (RAM),flash memory, etc., which are particularly structured to store andimplement the program instruction. Examples of the program instructionsinclude not only a mechanical language code formatted by a compiler butalso a high level language code that may be implemented by a computerusing an interpreter. The hardware devices may be configured to beoperated by one or more software modules or vice versa to conduct theprocesses according to the present invention.

Although the present invention has been described in terms of specificitems such as detailed elements as well as the limited embodiments andthe drawings, they are only provided to help more general understandingof the invention, and the present invention is not limited to the aboveembodiments. It will be appreciated by those skilled in the art to whichthe present invention pertains that various modifications and changesmay be made from the above description.

Therefore, the spirit of the present invention shall not be limited tothe above-described embodiments, and the entire scope of the appendedclaims and their equivalents will fall within the scope and spirit ofthe invention.

INDUSTRIAL APPLICABILITY

The present invention may be used in encoding/decoding an image.

1. An image decoding method comprising: decoding a predetermined modesameness indicator indicating whether or not an intra prediction mode ofa current block is a predetermined mode; in case the predetermined modesameness indicator indicating that the intra prediction mode of thecurrent block is the predetermined mode, determining the intraprediction mode of the current block to be the predetermined mode; incase the predetermined mode sameness indicator indicating that the intraprediction mode of the current block is not the predetermined mode,determining the intra prediction mode of the current block from among aplurality of intra prediction modes that do not contain thepredetermined mode; deriving a reference sample of intra prediction ofthe current block; generating a prediction block of the current block byperforming intra prediction of the current block based on the intraprediction mode and the reference sample; generating a residual block ofthe current block by performing inverse transformation on residual dataof the current block; and reconstructing the current block based on theprediction block and the residual block.
 2. The method of claim 1,wherein the predetermined mode is a planar mode.
 3. The method of claim1, wherein, in case the predetermined mode sameness indicator indicatingthat the intra prediction mode of the current block is not thepredetermined mode, the intra prediction mode of the current block isderived based on an MPM list for the current block and an indexindicating one mode inside the MPM list.
 4. The method of claim 3,wherein the MPM list does not include the predetermined mode.
 5. Animage encoding method comprising: determining an intra prediction modeof a current block; encoding a predetermined mode sameness indicatorindicating whether or not the intra prediction mode of the current blockis a predetermined mode based on the intra prediction mode of thecurrent block deriving a reference sample of intra prediction of thecurrent block; generating a prediction block of the current block byperforming intra prediction of the current block based on the intraprediction mode and the reference sample; generating a residual block ofthe current block based on the prediction block of the current block;and generating the residual data of the current block by performingtransformation on the residual block, wherein in case the intraprediction mode of the current block is the predetermined mode, thepredetermined mode sameness indicator is configured to indicate that theintra prediction mode of the current block is the predetermined mode, incase the intra prediction mode of the current block is not thepredetermined mode, the predetermined mode sameness indicator isconfigured to indicate that the intra prediction mode of the currentblock is determined from among a plurality of intra prediction modesthat do not contain the predetermined mode.
 6. The method of claim 5,wherein the predetermined mode is a planar mode.
 7. The method of claim5, wherein, in case the intra prediction mode of the current block isnot the predetermined mode, the predetermined mode sameness indicator isconfigured to indicate that the intra prediction mode of the currentblock is encoded using an MPM list for the current block and an indexindicating one mode inside the MPM list.
 8. The method of claim 7,wherein the MPM list does not include the predetermined mode.
 9. Anon-transitory computer readable recording medium storing a bitstreamwhich is received, decoded and used to reconstruct an image by an imagedecoding apparatus, wherein the bitstream comprises a predetermined modesameness indicator of a current block indicating whether or not an intraprediction mode of the current block is a predetermined mode andresidual data of the current block, in case the predetermined modesameness indicator indicating that the intra prediction mode of thecurrent block is the predetermined mode, the intra prediction mode ofthe current block is determined to be the predetermined mode, in casethe predetermined mode sameness indicator indicating that the intraprediction mode of the current block is not the predetermined mode, theintra prediction mode of the current block is determined from among aplurality of intra prediction modes that do not contain thepredetermined mode, the intra prediction mode is used with a referencesample of the intra prediction to generate a prediction block of thecurrent block by performing intra prediction of the current block, aresidual block of the current block is generated by performing inversetransformation on the residual data of the current block, and theprediction block is used with a residual block to reconstruct thecurrent block.